/**
 * Created by Liya on 2016/5/17.
 */
import React from 'react';
import {Form, Input, Button} from 'antd';
const FormItem = Form.Item;



class Support extends React.Component{
    handleBack(e){
        e.preventDefault();
        //UE.getEditor("ueText").destroy();
        this.context.router.push('/solution') // 页面跳转
    }
    handleSubmit(e) {
        e.preventDefault();

        this.props.form.validateFields((errors,value)=>{
            if (!!errors) {
                console.log('Errors in form!!!');
                return;
            }else {
                //var text = UE.getEditor("ueText").getContent();
                //UE.getEditor("ueText").destroy();
                var text=""
                getMarkValue().forEach(x=>{
                    text+=x+','

                })

                this.props.form.getFieldProps("Text",{initialValue:text.substring(0,text.length-1)})
                console.log('收到表单值：', this.props.form.getFieldsValue());
                //this.props.addSolution(this.props.form.getFieldsValue());
                //this.context.router.push('/solution') // 页面跳转
                //this.props.form.resetFields();
            }

        })
    }

    render(){

        const {getFieldProps, getFieldError, isFieldValidating} = this.props.form;
        const formItemLayout={
            labelCol: {span: 6},
            wrapperCol: {span: 14},
        }
            const nameProps = getFieldProps('Name', {
                rules: [
                    { required: true, min: 1, message: '用户名至少为 1个字符' }
                ],
                onChange: (e) => {
                    const value=e.target.value;

                }
            });
            return(
                <div>
                    <h2 style={{marginBottom:'20px'}}>在线支持</h2>

                    <div>
                        <p>建设中。。。</p>
                    </div>

                </div>
            )
        }

}
Support= Form.create()(Support)
export default  Support